<link rel="stylesheet" type="text/css" href="__TEMP__/{$style}/public/css/components.css">
<link rel="stylesheet" type="text/css" href="__TEMP__/{$style}/public/css/group_goods_list.css">
<style>
.two-list-menu {
    left: 109px;
	top:45px;
}

.wenzhang_list a{
	line-height: 44px;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-bottom: 1px solid #ddd;
	padding: 3px 7px;
	display: block;
}
</style>
<!-- 分类 -->
<div class="custom-tag-list clearfix">
    <div class="mask" id="grouGoodsListmask"></div>
	<div class="custom-tag-list-menu-block" >
		<div style="height: 294px; display: none;"></div>
		<ul class="custom-tag-list-side-menu" style="position: relative;" id='goods_group'>
			{foreach name="platform_help_class" id="class_vo" key="k"}
			<li>
				<a href="javascript:;" data-groupid="{$class_vo.class_id}" onclick="getArticleList({$class_vo.class_id},this)" {if condition="$k==0"}class="selected"{/if}>
					<span>{$class_vo.name}</span>
				</a>
			</li>
			{/foreach}
		</ul>
	</div>
		
    <div class="custom-tag-list-goods wenzhang_list" id='article_list'>
        
    </div>
</div>
<script>
$(function(){
	var selece_class_id = $('a.selected').attr('data-groupid');
	getArticleList(selece_class_id,'no');
})

function getArticleList(class_id,obj){
	if(obj != 'no'){
		$(".custom-tag-list-side-menu li a").removeClass("selected");
		$(obj).addClass("selected");	
	}
	$.ajax({
		type:"post",
		url : "{:__URL('APP_MAIN/Articlecenter/getArticleList')}",
		async : true,
		data : {'class_id':class_id },
		success : function(data){
			var article_list_html = '';
			for(var i =0 ;i<data['data'].length;i++){
				article_list_html +='<a href="'+__URL('APP_MAIN/Articlecenter/articlecontent?article_id='+data['data'][i]['article_id'])+'">'+data['data'][i]['title']+'</a>';
			}
			$('#article_list').html(article_list_html);
		}
	})
}
//通过文章ID获取文章内容
 function getgoodlist(id){
	
	return false;
	$('#grouGoodsListmask').hide();
	$('.two-list-menu').hide();
	$('.two-list-menu li[pid]').hide();
	$.ajax({
		type:"post",
		url : "{:__URL('APP_MAIN/Articlecenter/index')}",
		async : true,
		data : {'id':id },
		beforeSend:function(){
			showLoadMaskLayer();
		},
		success : function(data){
			var html = '';
			html+='<p style="padding-left: 40%;">'+data['title']+'</p>';
			if(data['content']==''){
				html+='<p style="font-size:12px;">暂无相关内容</p>';
			}else{
				html+='<p style="font-size:12px;" id="content_html"></p>';
			}
			$('#good_list').html(html);
			$('#content_html').html(data['content']);
			hiddenLoadMaskLayer();
		}
	});
} 
</script>
